﻿
<div class="white description-cmm row">
<?php echo $this->Bread->Breadcrumb(
	array('Comunidades'=>'/communities',$community['Community']['name']=>''
	)); ?>
					<h4 class="title-upper"> <?php echo $community['Community']['name']; ?> </h4>
						<p>
							<strong>Sobre esta comunidade : </strong>
							<div><?php echo $community['Community']['description']; ?></div></br>
							<strong>Tag: </strong>
							<div><?php echo $tags ?></div>
						</p>
					</div>



					<div class="white row">

						<h4 class="border-bottom header-list-tpcs ">
							<div class="row">
							<?php 
															
								if (($this->Community->userPart($this->User->id(),$community['Community']['id'])== 'a') ||
                                         ($this->Community->userPart($this->User->id(),$community['Community']['id']) == 'm')) { ?>
								<div class="col-lg-2 text title-upper">Tópicos</div>
								
								<form class="col-lg-8 navbar-form pull-left ">
								  <input type="text" class="form-control" placeholder='Busque tópicos...' style="width: 500px;"> 
								</form>
								<?php } ?>
								<?php 
                                
                                
								if (($this->Community->userPart($this->User->id(),$community['Community']['id']) == 'a') || 
                                        ($this->Community->userPart($this->User->id(),$community['Community']['id']) == 'm')) { ?>
									<a data-toggle="modal" data-cmm='<?php echo $community['Community']['id'] ?>' href="#box-modal" class="btn btn-primary btn-modal-add-tpc"	>Adicionar Tópico</a>
								<?php } ?>

								<!-- model adicioanr topico -->
	
								<div class="modal fade" id="box-modal">
								  <div class="modal-dialog">
								    <div class="modal-content">
								      <div class="modal-header">
								        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
								        <h4 class="modal-title"></h4>
								      </div>
								      <div class="modal-body modal-body-add-tpc">
								       
								      </div>
								      <div class="modal-footer">
								    
								      </div>
								    </div><!-- /.modal-content -->
								  </div><!-- /.modal-dialog -->
								</div><!-- /.modal -->
							</div>
						</h4>

			
		<?php
			$i = 0;
			foreach ($topics as $topic) 
			{
                
            //$user_comment =  $this->User->AllInfo($topic['Topic']['user_id']);
		?>

			<div class="col-lg-12 box-topic">
				<div class="media">
				  <a class="pull-left" href="#">
				    <img class="media-object img-circle-feed shadow"src="/img/users/<?php echo $topic['User']['photo'] ?>">
				  </a>
				  <div class="media-body shadow" >
				  	
					<h3 class="panel-title"><strong><a href="/!<?php echo $community['Community']['url']; ?>/<?php echo $topic['Topic']['url']; ?>"><?php echo $topic['Topic']['name']; ?></a></strong>  <p><small>Criado por <?php echo $topic['User']['first_name'] . ' ' . $topic['User']['last_name'] ?></small></p></h3>	
					<?php //echo $this->Form->postLink('Deletar', array('action' => '/topics/delete', $topic['Topic']['id'], $topic['Topic']['id']), array('confirm' => 'Tem certeza que quer excluir este tópico?'));  ?>				
				    <!-- Nested media object -->
				  </div>
				</div>
			</div>
		<?php } ?>

		


